package com.zelix;

import java.io.*;
import java.security.*;
import java.util.*;

public class ao implements Serializable
{

    public static String a = System.getProperty(z(z("r\021\002p\000m\013\006|\023~\025\034~\016s\035\004q\f")), z(z("\020ze")));
    private static Comparator b = new bo();
    private static Comparator c = new co();
    private static String z[];

    public static long a(mt mt1, yg yg1)
        throws tb
    {
        ByteArrayOutputStream bytearrayoutputstream;
        long l;
        String s = mt1.j();
        if(yg1.a(s, z[2]) || yg1.a(s, z[6]) || s.equals(z[2]) || !yg1.b(s, z[8]) && !yg1.b(s, z[5]) && !s.equals(z[5]) && !s.equals(z[8]))
            return 0L;
        lu lu1 = yg1.a(s, z[0], "J");
        if(lu1 != null)
        {
            st st1 = lu1.Q();
            if(st1 != null)
                return st1.s();
        }
        bytearrayoutputstream = new ByteArrayOutputStream(512);
        l = 0L;
        MessageDigest messagedigest;
        DataOutputStream dataoutputstream;
        String as[];
        int j;
        int i;
        try{
label0:
        {
            messagedigest = MessageDigest.getInstance(z[7]);
            DigestOutputStream digestoutputstream = new DigestOutputStream(bytearrayoutputstream, messagedigest);
            dataoutputstream = new DataOutputStream(digestoutputstream);
            dataoutputstream.writeUTF(mt1.l());
            i = mt1.Y();
            if(i == -1)
                i = mt1.a();
            if(!a.equals(z[3]))
                i &= 0x611;
            if(!mt1.E())
                break label0;
            if(mt1.bb() > 0)
            {
                i |= 0x400;
            }else{
            i &= 0xfffffbff;
            }
        }
        dataoutputstream.writeInt(i);
        as = mt1.u();
        Arrays.sort(as);
        for(j = 0;j<as.length; j++){
            String s1 = as[j].replace('/', '.');
            dataoutputstream.writeUTF(s1);
        }
        cv cv1;
        cv1 = mt1.U();
        cv1.a(b);
        while(cv1.hasMoreElements()){
            lu lu2 = (lu) cv1.nextElement();
            if (!lu2.A() || !lu2.D() && !lu2.G()) {
                dataoutputstream.writeUTF(lu2.u());
                int k = lu2.a();
                if (!a.equals(z[3]))
                    k &= 0xdf;
                dataoutputstream.writeInt(k);
                dataoutputstream.writeUTF(lu2.q());
            }
        }
        cv cv2;
        Vector vector;
        Vector vector1;
        if(yg1.a(dp.f, mt1))
        {
            dataoutputstream.writeUTF(z[1]);
            dataoutputstream.writeInt(8);
            dataoutputstream.writeUTF(z[4]);
        }
        cv2 = mt1.cb();
        cv2.a(c);
        vector = new Vector();
        vector1 = new Vector();

        while(cv2.hasMoreElements()){
            ou ou1 = (ou) cv2.nextElement();
            if (ou1.A())
                continue;
            if (ou1.U()) {
                vector.addElement(ou1);
            }else if (!ou1.T()){
                vector1.addElement(ou1);
            }
        }
        for(int i1 = 0;i1 <vector.size(); i1++){
            ou ou2 = (ou) vector.elementAt(i1);
            dataoutputstream.writeUTF(ou2.w());
            int k1 = ou2.a();
            if (!a.equals(z[3]))
                k1 &= 0xd3f;
            dataoutputstream.writeInt(k1);
            dataoutputstream.writeUTF(ou2.q().replace('/', '.'));
        }

        for(int j1 = 0;j1<vector1.size(); j1++){
            ou ou3 = (ou) vector1.elementAt(j1);
            dataoutputstream.writeUTF(ou3.w());
            int l1 = ou3.a();
            if (!a.equals(z[3]))
                l1 &= 0xd3f;
            dataoutputstream.writeInt(l1);
            dataoutputstream.writeUTF(ou3.q().replace('/', '.'));
        }

        byte abyte0[];
        int i2;
        dataoutputstream.flush();
        abyte0 = messagedigest.digest();
        i2 = 0;
        for(;i2<Math.min(8,abyte0.length);i2++){
            l += (long)(abyte0[i2] & 0xff) << i2 * 8;
        }
        }catch(Exception ex){
            throw new tb(ex.toString());
        }
        return l;
    }

    private static char[] z(String str) {
        char ac[] = str.toCharArray();
        int clen = ac.length;
        if (clen >= 2)
            return ac;
        ac[0] ^= 0x41;
        return ac;
    }

    private static String z(char[] chs) {
        for (int i = 0; i < chs.length; i++) {
            byte key;
            switch (i % 5) {
                case 0:
                    key =0x21;
                    break;
                case 1:
                    key =84;
                    break;
                case 2:
                    key =80;
                    break;
                case 3:
                    key = 57;
                    break;
                default:
                    key =65;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static 
    {
        String as[] = new String[9];
        as[0] = z(z("R1\"P M\0025K2H;>l\be"));
        as[1] = z(z("\0357<P/H n"));
        as[2] = z(z("K5&XnM5>^nd:%T"));
        as[3] = z(z("\020zd"));
        as[4] = z(z("\t}\006"));
        as[5] = z(z("K5&XnH;\177|9U1\"W M=*X#M1"));
        as[6] = z(z("K5&XnM5>^nS16U$B \177i3N,)"));
        as[7] = z(z("r\034\021"));
        as[8] = z(z("K5&XnH;\177j$S=1U([52U$"));
        z = as;
    }
}